package main

func minDeletionSize(strs []string) int {
	n := len(strs[0])
	res := 0
	cnt := len(strs)
	for i := 0; i < n; i++ {
		for j := 0; j < cnt-1; j++ {
			if strs[j][i] > strs[j+1][i] {
				res++
				break
			}
		}
	}
	return res
}
